home *** CD-ROM | disk | FTP | other *** search
- class ScoreInterface
- {
- var mVariables;
- var mLoadCallback;
- var SCORE_LOAD_URL = "getScore.asp";
- var SCORE_SAVE_URL_PREFIX = "score.asp";
- function ScoreInterface()
- {
- this.mVariables = new LoadVars();
- }
- function saveScore(name, score, email, state, callback)
- {
- this.mLoadCallback = callback;
- var _loc2_ = "";
- _loc2_ += "score=" + score;
- _loc2_ += "&nick=" + name;
- _loc2_ += "&email=" + email;
- _loc2_ += "&state=" + state;
- trace("ScoreInterface::saveScore: sending [" + _loc2_ + "]");
- var _loc3_ = RC4.encrypt(_loc2_,"U4D$3R3e#");
- this.mVariables = new LoadVars();
- this.mVariables.onLoad = this.onScoresSave;
- this.mVariables.mLoadCallback = callback;
- this.mVariables.mVariables = this.mVariables;
- trace("ScoreInterface::saveScore: encrypted as [" + this.SCORE_SAVE_URL_PREFIX + "?k=" + _loc3_ + "]");
- this.mVariables.load(this.SCORE_SAVE_URL_PREFIX + "?k=" + _loc3_);
- }
- function onScoresSave(success)
- {
- trace("ScoreInterface::onScoresSave: success is [" + success + "]");
- if(success)
- {
- if(this.mVariables.res > 0)
- {
- this.mLoadCallback.onScoreSave();
- }
- else
- {
- this.mLoadCallback.onScoreSaveError();
- }
- }
- else
- {
- this.mLoadCallback.onScoreSaveError();
- }
- }
- }
-